const getParams = name => {
  try {
    var url = window.document.location.href;
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = url.split('?')[1].match(reg);
    if (r != null) {
      return r[2];
    }
    return "";
  } catch (e) {
    return "";
  }
}

export { getParams }